package javacode.chapter07;

import java.util.Scanner;

public class Example7_2 {
    public static void main(String[] args) {
        // try...catch...finally异常处理
        Scanner scanner = new Scanner(System.in);
        try {
            System.out.print("请输入被除数：");
            int num1 = scanner.nextInt();
            System.out.print("请输入除数：");
            int num2 = scanner.nextInt();
            System.out.println(num1 + "/" + num2 + "=" + (num1 / num2));
        }catch (Exception e){
            System.out.println("产生了异常！");
        }finally {
            System.out.println("程序结束！");
        }
    }
}
